package org.kinglone.back.comment.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.kinglone.back.article.model.Article;


/**
 * 评论表实体类
 * @author yejinlong
 * 2017年7月25日
 * @version 1.0
 */
@Entity
@Table(name="comment")
public class Comment implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id @GenericGenerator(name = "generator", strategy = "uuid.hex")
	@GeneratedValue(generator = "generator")
	@Column(name="sysid", unique = true, nullable = false, length = 32)
	private String sysid;
	
	//父id
	@Column(name="pid",length = 32)
	private String pid;
	
	
	//创建时间
	@Column(name="createtime",nullable = false,length=20)
	private String createTime;
	
	//昵称
	@Column(name="nickname",nullable=false,length=32)
	private String nickname;
	
	//邮箱
	@Column(name="email",nullable=false,length=256)
	private String email;
	
	//网址
	@Column(name="websiteUrl",length=256)
	private String websiteUrl;
	//内容
	@Column(name="content",nullable=false,length=2000)
	private String content;
	
	//是否显示  Y:显示  N:不显示
	@Column(name = "isDisplay", nullable = false, length = 1)
	private String isDisplay;
	
	
	//文章id
	@ManyToOne(fetch = FetchType.EAGER)	
	@JoinColumn(name="articleId", nullable = false) 
	private Article article;
	
	public Comment() {
	}

	public Comment(String sysid, String pid, String createTime,
			String nickname, String email, String websiteUrl, String content,
			String isDisplay, Article article) {
		super();
		this.sysid = sysid;
		this.pid = pid;
		this.createTime = createTime;
		this.nickname = nickname;
		this.email = email;
		this.websiteUrl = websiteUrl;
		this.content = content;
		this.isDisplay = isDisplay;
		this.article = article;
	}

	public String getSysid() {
		return sysid;
	}

	public void setSysid(String sysid) {
		this.sysid = sysid;
	}

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getWebsiteUrl() {
		return websiteUrl;
	}

	public void setWebsiteUrl(String websiteUrl) {
		this.websiteUrl = websiteUrl;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getIsDisplay() {
		return isDisplay;
	}

	public void setIsDisplay(String isDisplay) {
		this.isDisplay = isDisplay;
	}

	public Article getArticle() {
		return article;
	}

	public void setArticle(Article article) {
		this.article = article;
	}

	
	

		
	
}
